package com.molyfun.parents.zhibo.im;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:03/01/2018.
 * <p>
 * type text 文字
 * <p>
 * <p>
 * 用户进入房间: 		聊天室广播   eventtype : room        opertype : enter
 * data:
 * usercount           //当前房间人数
 * <p>
 * 用户离开房间: 		聊天室广播   eventtype : room        opertype : leave
 * data:
 * <p>
 * 用户申请连麦: 		聊天室广播   eventtype : meeting     opertype : apply
 * data:
 * <p>
 * 用户申请连麦取消: 	聊天室广播   eventtype : meeting     opertype : cancel
 * data:
 * <p>
 * 用户停止连麦: 		聊天室广播   eventtype : meeting     opertype : stop
 * data:
 * <p>
 * 用户连麦邀请确认: 	目标广播     eventtype : meeting     opertype : inviteconfim
 * data:
 * invitekey	   //邀请key
 * targetuserid       //连麦被邀请人id
 * <p>
 * 用户连麦邀请取消: 	目标广播     eventtype : meeting     opertype : invitecancel
 * data:
 * invitekey	   //邀请key
 * targetuserid       //连麦被邀请人id
 * 消息发送		聊天室广播   eventtype : msg     	opertype : send
 * data:
 * content	   	   //内容
 * username	   //用户名
 * usertype	   //1:家长  2:老师
 * type		   //ques:提问    msg:普通消息
 */

public class ImModel<T> {

    private String eventtype;

    private String opertype;

    private IMUserModel user;

    private T data;

    public String getEventType() {
        return eventtype;
    }

    public void setEventType(String type) {
        this.eventtype = type;
    }

    public IMUserModel getUser() {
        return user;
    }

    public void setUser(IMUserModel user) {
        this.user = user;
    }

    public T getData() {
        return data;
    }

    public void setData(T body) {
        this.data = body;
    }

    public String getOpertype() {
        return opertype;
    }

    public void setOpertype(String opertype) {
        this.opertype = opertype;
    }

    public static class IMMsgBody {
        private String content;

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }
    }

    public static class IMUserModel {

        private String userid;

        private String username;

        private String imgurl;

        private String sex;

        public String getUserName() {
            return username;
        }

        public void setUserName(String userName) {
            this.username = userName;
        }

        public String getImageUrl() {
            return imgurl;
        }

        public void setImageUrl(String userAvator) {
            this.imgurl = userAvator;
        }

        public String getId() {
            return userid;
        }

        public void setId(String id) {
            this.userid = id;
        }

        public String getSex() {
            return sex;
        }

        public void setSex(String sex) {
            this.sex = sex;
        }
    }

    public static class UserCountBody {

        public UserCountBody(String userCount) {
            this.usercount = userCount;
        }

        private String usercount;

        public String getUsercount() {
            return usercount;
        }

        public void setUsercount(String usercount) {
            this.usercount = usercount;
        }
    }

    public static class UserCountModel extends ImModel<UserCountBody> {}

    public static class RtcInviteModel extends ImModel<RtcInviteBody> {}

    public static class RtcStartModel extends ImModel<RtcStartBody> {}

    public static class RtcStartBody {

        public RtcStartBody(String channel) {
            this.channel = channel;
        }

        private String channel;

        public String getChannel() {
            return channel;
        }

        public void setChannel(String channel) {
            this.channel = channel;
        }
    }


    public static class RtcInviteBody {

        public RtcInviteBody(String invitekey, String targetuserid) {
            this.invitekey = invitekey;
            this.targetuserid = targetuserid;
        }

        private String invitekey;
        private String targetuserid;

        public String getInvitekey() {
            return invitekey;
        }

        public void setInvitekey(String invitekey) {
            this.invitekey = invitekey;
        }

        public String getTargetuserid() {
            return targetuserid;
        }

        public void setTargetuserid(String targetuserid) {
            this.targetuserid = targetuserid;
        }
    }

    public static class ImStringModel extends ImModel<StringMsgBody> {}

    /**
     * eventtype : msg     	opertype : send
     * data:
     * content	   	   //内容
     * username	   //用户名
     * usertype	   //1:家长  2:老师
     * type		   //ques:提问    msg:普通消息
     */
    public static class StringMsgBody {

        public StringMsgBody(String content, String username, String usertype, String type) {
            this.content = content;
            this.username = username;
            this.usertype = usertype;
            this.type = type;
        }

        private String content;
        private String username;
        private String usertype;
        private String type;

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getUsertype() {
            return usertype;
        }

        public void setUsertype(String usertype) {
            this.usertype = usertype;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }
    }


    /**
     * timelen 时长（秒）		音视频 open,pause,seek需要
     * timepoint 播放时间点（秒）	音视频 open(第一次open传0),pause,seek需要
     */
    public static class GalleryBody {
        String id;
        String gtype;
        String isgame;
        String url;
        String name;
        String logo;
        int timelen;
        int timepoint;

        public String getGtype() {
            return gtype;
        }

        public void setGtype(String gtype) {
            this.gtype = gtype;
        }

        public String getIsgame() {
            return isgame;
        }

        public void setIsgame(String isgame) {
            this.isgame = isgame;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getLogo() {
            return logo;
        }

        public void setLogo(String logo) {
            this.logo = logo;
        }

        public int getTimelen() {
            return timelen;
        }

        public void setTimelen(int timelen) {
            this.timelen = timelen;
        }

        public int getTimepoint() {
            return timepoint;
        }

        public void setTimepoint(int timepoint) {
            this.timepoint = timepoint;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }
    }

    /**
     * open seek定位到位置之后直接播放
     * pause如果带位置，定位到位置后暂停
     */
    public interface GalleryOperateType {
        int OperateTypeOpen = 1001;
        int OperateTypeClose = 1002;
        int OperateTypePause = 1003;
        int OperateTypeSeek = 1004;
    }

}

